package com.project.common.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
//    public static String APP_ID = "2016101600700911";
    public static String APP_ID = "2021000118680153";

    // 商户私钥，您的PKCS8格式RSA2私钥
//    public static String APP_PRIVATE_KEY = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDrmEEwhMPxBEwjjpHCRpQkPYgNN+f72xGUR8itwkyPSF4aV6bK+WhKvhz6kOF/GQLvF4ibtkbPH7tgbkfOIUqI3Ii2uxC7s1gnafhnfPpAkt/A0XRCK2AnHokS7cueOUAlo9josHriQK7OmA9SqaOVOH22NhFV7chyZzykrT+hrMuN4Duht6+0BzOLqtmGuIwNqLrDTjruR+LOkPMQvrhOSNqmX++7CS1yEoSn9gK5UXkW9fBeQqc5H/oEvLNwDekYlvY8bJXXjCw+ZZqZC4LpHEwaWfxSMd/N4iQLYaO0LD7Kk6WInT1nv+o4y1nLncSZQUtKljefOOHX2AKxEh7fAgMBAAECggEBANr5z027eSvhpKs/7na2hycQEg7HMdZEDhjWh84JVIOw7dZqNdte6fLetaynURCDPNjh9NVWHIaTpePBXPhYtSB0apX9VVZBIeSweHQoE6pFWbesdvSxwFNb7Ggtoh5UdC0IF6pfrjfxiwj3CPb6OdOOiDn+EyrdMnwzPIiLhyNK4fMKW2sSbkFgI/uJ53hujRLp0i46JbrM7FC3fBdTjV8DZfNHZg7Dz/ZLZ2Xw5XhsbHcn1oHweBPb2b94ArHoFunkn2TiXg6F0YG2p97iuM5fTpr9N5B2DfboY2bZuP+/IgcpPanztz1rBY7+4tG5VbEYywysfdA2ZVkvvs+/vqECgYEA992rTPBY4CGICro6UK05K2k62KhFMzI5g+fCa2UFmyb90xcTiHe4hB1w3/0wWwozU7LFPFqcV+IsyH3LJOIrPiwOQDw2J+CLUCI4JNWEoBdNtCH3W10wbHPKpUJN6YfoN8Z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8D46pHApo/iCiffgdI8GjP17Scvsp7PnWfkigN+KE5fLJg4FUCgYEA/OQTX+HhdFBgqq15IDs/+XhHG+XHY7SKyJyOz7kwZCLpdLsqi+64cCSD7V+jgJHDPDilz6AAt2yUcfMg85ibgemvCJrj+71wDctDLDSUTOXCUA8WXrtpRYNmaFUu370qVIGIRiaFcI/iL+LIy8gT9EVnFnGhK2iNdtwjhXNjRzg=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
//    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnbef0ZvBGXL4QGQ8Gd2DSw6JBOThMmKrYkY76ksfDcMrLEAK3hY6qsaVUycvL3xql2ez/P0ecd5VuBVMGPHcVIaeDTyO7pIGufilFyjzHuCefv/fMgSXGqSranF9zgU9+tUKTT4GMBc4VcIKz8/sJnm4L80pYMyLXfAg/XMowGds6f6rQmATfktm3Vd38cFxwa+UIVqNFVSjpNNCX1W54FGCWrF9mXQHT3hdT5aH+spGBU3GpOeILsNDwXyzOOIJszcUPJsop5MXcuH/mPUAlIh/hVFUoBk2og+6/2SD5fdoceZYCFjl0o8c1Eo62w6Q5jVFwz5d2M6QyirQ3JdSwIDAQAB";
    public static String ALIPAY_PUBLIC_KEY ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsTSKD834ua1jfKu5INrFAaImGJcha1BcaWz/vGOxms3CE3cYLvFlwjAbGuIZ4o9olxnMFYqNnepLY/xcCx46xn9TalcsGcV8NbCeymlRJ9sj8HSLj3mjq2MuAIG6MljBM8ZWZR9EBzpLaxNguY4BSaWe6JlCEnfEtD/g6yCSKYuluRAA4YR5BsqO+jV8utt2hZlGkhHxR//FTwZQaA+ndQdPcZxhyY+A/Gs5s/HhXXgvi6ItWvnYKh/4SB3yObnKvkHYQDzCNQltgA57yCeumXduOgwhv40nmXkx85NkTnW3akyc1s7WplkoMbd+vK5/PTS5Mi41RAhHxEF8SqG/PQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://127.0.0.1:8080/AlipayController/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://127.0.0.1:8080/AlipayController/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 数据传输格式
    public static String FORMAT = "json";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "E:\\paylog";

    //转账相关配置
    public static String payer_show_name = "xxx";

    //收款方账户类型
    public static String payee_type = "ALIPAY_LOGONID";


    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
